<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!doctype html>
 <html lang="zh-CN">
 <head>
   <meta charset="UTF-8">
   <%@ include file="/share/systemInclude.jsp" %>
   
   <script type="text/javascript">
      $(function(){  
        $(".list_table").colResizable({
          liveDrag:true,
          gripInnerHtml:"<div class='grip'></div>", 
          draggingClass:"dragging", 
          minWidth:30
        }); 
        
        //表单提交前 验证 表单
        $("#updateForm").Validform({
			btnSubmit : "#btn_sub",
			tiptype : 3,
			beforeCheck:function(curform){
				 
			 },
			 beforeSubmit:function(data){
				 
			 }
		});
        
        //加载异步上次图片
        $('#shopLogo').click();
      });
      
      function selectBond(value){
      	var money = $('#shopAllMoney').val();
      	if(value == '1'){
      		$('#shopAllMoney').val('0.00');
      	}
      	if(value == '2' && (money == null || money == '' || money == '0.00')){
      		$('#shopAllMoney').val('');
      	}
      }
   </script>
   <title>Document</title>
 </head>
 <body>
  <div class="container">
   <div id="forms" class="">
        <div class="box">
          <div class="box_border">
            <div class="box_top">
            	<b class="pl15">
            		<c:if test="${operateStatus == 'sysAdd' }">
						添加店铺：
					</c:if>
					<c:if test="${operateStatus == 'sysEdit' }">
						编辑店铺：
					</c:if>
            	</b>
            </div>
            <div class="box_center">
              <form id="updateForm" action="${root }/control/shop/shopController/${operateStatus}.do" class="jqtransform" method="post">
               <input type="hidden" name="shopId" value="${shop.shopId }" class="input-text lh30" size="40"/>
               <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                 <tr>
                  <td class="td_right"><span class="need">*</span>shopName：</td>
                  <td class=""> 
                    <input type="text" maxlength="50" name="shopName" value="${fn:escapeXml(shop.shopName)}" class="input-text lh30" size="40" dataType="*1-50">
                  </td>
                </tr>
                <tr >
                  <td class="td_right"><span class="need">*</span>City：</td>
                  <td class="">
                    <span class="fl">
                      <div class="select_border"> 
                        <div class="select_containers ">
                        <c:if test="${not empty cityList }">
                        	<select name="cityId" class="select" style="width:150px;" nullmsg="Please Choose!" dataType="*">
	                        	<option value="">Please Choose!</option>
	                        	<c:forEach items="${cityList }" var="city">
	                        		<option value="${city.cityId }" <c:if test="${shop.cityId == city.cityId }">selected="selected"</c:if>>${fn:escapeXml(city.cityName)}</option>	
	                        	</c:forEach>
	                        </select>
                        </c:if>
                        <c:if test="${empty cityList }">
                        	<select name="cityId" class="select" dataType="*">
	                        	<option>请先进行城市管理</option>
	                        </select>
                        </c:if>
                        </div> 
                      </div> 
                    </span>
                  </td>
                 </tr>
                <tr>
                  <td class="td_right"><span class="need"></span>ShopLogo：</td>
                  <td class="">
                  	<span id="shopLogoShow">
						<c:if test="${not empty shop.shopLogo}">
							<img id="shopLogoImage" src="${imageService }${shop.shopLogo}" alt="" style="width: 200px;height: 200px;" />
						</c:if>
					</span>
					<input type="hidden" name="oldShopLogo" value="${shop.shopLogo}" />
					<input type="hidden" id="shopLogoValue" name="shopLogo" value="${shop.shopLogo}" ignore="ignore"/>
					<input type="button" name="button" class="btn btn82 btn_add" id="shopLogo" value="Logo" onclick="uploadImage('shopLogo','shopLogoShow','shopLogoValue','${imageService}');" />
                  </td>
                </tr>
                <tr>
                  <td class="td_right"><span class="need">*</span>shopUserName：</td>
                  <td class=""> 
                  	<c:if test="${operateStatus == 'sysAdd' }">
						<input maxlength="30" type="text" name="shopUser.shopUserName" value="${fn:escapeXml(shopUser.shopUserName)}" class="input-text lh30" size="40" dataType="*1-30" ajaxurl="${root}/supply/globalController/findCheck.do?tabName=shop_user&json=${shopUser.shopUserName }&msg=店铺登录名&status=3&statusName=shopStatus&statusRelation=2"> 系统自动生成初始化密码123456
					</c:if>
					<c:if test="${operateStatus == 'sysEdit' }">
						${fn:escapeXml(shopUser.shopUserName)}
					</c:if>
                  </td>
                </tr>
                <tr>
                	<td class="td_right"><span class="need"></span>联系人：</td>
                	<td><input type="text" maxlength="50" name="shopContact" value="${fn:escapeXml(shop.shopContact)}" class="input-text lh30" size="40" ignore="ignore" dataType="*1-50"></td>
                </tr>
                <tr>
                	<td class="td_right"><span class="need"></span>联系电话：</td>
                	<td><input type="text" maxlength="20" name="contactTel" value="${fn:escapeXml(shop.contactTel)}" class="input-text lh30" size="40" ignore="ignore" dataType="*1-20"></td>
                </tr>
                <tr>
                	<td class="td_right"><span class="need"></span>地址：</td>
                	<td><input type="text" maxlength="100" name="shopAddress" value="${fn:escapeXml(shop.shopAddress)}" class="input-text lh30" size="40" ignore="ignore" dataType="*1-100"></td>
                </tr>
                 <tr>
                  <td class="td_right"><span class="need"></span>简介：</td>
                  <td class="">
                    <textarea maxlength="2000" name="shopIntro" id="" cols="30" rows="10" class="textarea" ignore="ignore" dataType="*1-2000">${fn:escapeXml(shop.shopIntro)}</textarea>
                  </td>
                 </tr>
                 <tr>
                  <td class="td_right"><span class="need">*</span>保障金：</td>
                  <td class="">
                    <input type="radio" onclick="selectBond('1');" value="1" <c:if test="${empty shop.shopBondStatus or shop.shopBondStatus == 1 }">checked="checked"</c:if> name="shopBondStatus"> 未交
                    <input type="radio" onclick="selectBond('2');" value="2" <c:if test="${shop.shopBondStatus == 2 }">checked="checked"</c:if> name="shopBondStatus"> 已交
                  </td>
                 </tr>
                 <tr>
                  <td class="td_right"><span class="need">*</span>保障金金额：</td>
                  <td class="">
                  	<c:if test="${not empty shop.shopAllMoney }">
                  		<input type="text" id="shopAllMoney" maxlength="10" name="shopAllMoney" value="${fn:escapeXml(shop.shopAllMoney)}" class="input-text lh30" size="40" dataType="/^\d{1,7}(\.\d{1,2})?$/" nullmsg="Please fill in the moeny!" errormsg="The largest money of not more than 9999999!">
                  	</c:if>
                  	<c:if test="${empty shop.shopAllMoney }">
                  		<input type="text" id="shopAllMoney" maxlength="10" name="shopAllMoney" value="0.00" class="input-text lh30" size="40" dataType="/^\d{1,7}(\.\d{1,2})?$/" nullmsg="Please fill in the moeny!" errormsg="The largest money of not more than 9999999!">
                  	</c:if>
                  </td>
                </tr>
                 <tr>
                   <td class="td_right">&nbsp;</td>
                   <td class="">
                     <input id="btn_sub" type="button" name="button" class="btn btn82 btn_save2" value="保存" >
                    <input type="button" name="button" class="btn btn82 btn_res" value="返回" onclick="location.href='javascript:history.go(-1)'"> 
                   </td>
                 </tr>
               </table>
               </form>
            </div>
          </div>
        </div>
     </div> 
  </div> 
 </body>
 </html>
  